package cn.ywang.spring.framework.beans.factory.config;

/**
 * @author BeatificWang
 * @date 2019/4/21 22:55
 */
public class BeanDefinition {

	private String beanClassName;

	private boolean lazyInit = false;

	private boolean isSingleton = true;

	private String factoryBeanName;

	private String factoryMethodName;

	/**
	 * Return the current bean class name of this bean definition.
	 */
	public String getBeanClassName() {
		return this.beanClassName;
	}

	/**
	 * Specify the bean class name of this bean definition.
	 */
	public void setBeanClassName(String beanClassName) {
		this.beanClassName = beanClassName;
	}

	public boolean isLazyInit() {
		return this.lazyInit;
	}

	public void setLazyInit(boolean lazyInit) {
		this.lazyInit = lazyInit;
	}

	public boolean isSingleton() {
		return this.isSingleton;
	}

	public void setSingleton(boolean singleton) {
		this.isSingleton = singleton;
	}

	/**
	 * Return the factory bean name, if any.
	 */
	public String getFactoryBeanName() {
		return this.factoryBeanName;
	}

	/**
	 * Specify the factory bean to use, if any.
	 * This the name of the bean to call the specified factory method on.
	 *
	 * @see #setFactoryMethodName
	 */
	public void setFactoryBeanName(String factoryBeanName) {
		this.factoryBeanName = factoryBeanName;
	}

	/**
	 * Return a factory method name, if any.
	 */
	public String getFactoryMethodName() {
		return this.factoryMethodName;
	}

	/**
	 * Specify a factory method, if any. This method will be invoked with
	 * constructor arguments, or with no arguments if none are specified.
	 * The method will be invoked on the specified factory bean, if any,
	 * or otherwise as a static method on the local bean class.
	 *
	 * @see #setFactoryBeanName
	 * @see #setBeanClassName
	 */
	public void setFactoryMethodName(String factoryMethodName) {
		this.factoryMethodName = factoryMethodName;
	}
}
